package com.gc.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.gc.business.mapper.FinancialManagementMapper;
import com.gc.business.domain.FinancialManagement;
import com.gc.business.service.IFinancialManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;

/**
 * 财务管理 服务层实现
 * 
 * @author liujinteng
 * @date 2020-11-06
 */
@Slf4j
@Service
public class FinancialManagementServiceImpl extends ServiceImpl<FinancialManagementMapper, FinancialManagement> implements IFinancialManagementService {

    @Override
    public List<FinancialManagement> list(FinancialManagement financialManagement){
        LambdaQueryWrapper<FinancialManagement> wrapper = new LambdaQueryWrapper<>();
        if(financialManagement != null){
            if(StringUtils.isNotEmpty(financialManagement.getFinancialId())){
                wrapper.eq(FinancialManagement::getFinancialId, financialManagement.getFinancialId());
            }
            if(StringUtils.isNotEmpty(financialManagement.getClientName())){
                wrapper.like(FinancialManagement::getClientName, financialManagement.getClientName());
            }
            if(StringUtils.isNotEmpty(financialManagement.getSignContractName())){
                wrapper.like(FinancialManagement::getSignContractName, financialManagement.getSignContractName());
            }
            if(StringUtils.isNotEmpty(financialManagement.getContractAmount())){
                wrapper.eq(FinancialManagement::getContractAmount, financialManagement.getContractAmount());
            }
            if(StringUtils.isNotEmpty(financialManagement.getReceiveAmount())){
                wrapper.eq(FinancialManagement::getReceiveAmount, financialManagement.getReceiveAmount());
            }
            if(StringUtils.isNotEmpty(financialManagement.getUncollectAmount())){
                wrapper.eq(FinancialManagement::getUncollectAmount, financialManagement.getUncollectAmount());
            }
            if(StringUtils.isNotEmpty(financialManagement.getSignDate())){
                wrapper.eq(FinancialManagement::getSignDate, financialManagement.getSignDate());
            }
            if(StringUtils.isNotEmpty(financialManagement.getRemark())){
                wrapper.eq(FinancialManagement::getRemark, financialManagement.getRemark());
            }
            if(StringUtils.isNotEmpty(financialManagement.getCreateBy())){
                wrapper.eq(FinancialManagement::getCreateBy, financialManagement.getCreateBy());
            }
            if(StringUtils.isNotEmpty(financialManagement.getCreateTime())){
                wrapper.eq(FinancialManagement::getCreateTime, financialManagement.getCreateTime());
            }
            if(StringUtils.isNotEmpty(financialManagement.getUpdateBy())){
                wrapper.eq(FinancialManagement::getUpdateBy, financialManagement.getUpdateBy());
            }
            if(StringUtils.isNotEmpty(financialManagement.getUpdateTime())){
                wrapper.eq(FinancialManagement::getUpdateTime, financialManagement.getUpdateTime());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
